//
//  ViewController.swift
//  C003_test_addSubView
//
//  Created by yao_yu on 15/5/18.
//  Copyright (c) 2015年 yao_yu. All rights reserved.
//

import UIKit

class MyUIView: UIView {
    
}

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        
        let view2 = UIView(frame: CGRectZero)
        
        //重复添加多次
        for _ in 1...50{
            view.addSubview(view2)
        }
        
        //结果, 只添加了一次
        //view.subviews中只有三项, 前两项是_UILayoutGuide
        print(view.subviews.count)
        for i in view.subviews{
            print(i)
        }
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


}

